<div class="layui-card-body">
    <form class="layui-form" action="{:url()}" style="width: 500px;" method="post">
        <blockquote class="layui-elem-quote">一级菜单必须选择'一级菜单',子菜单不能选择'一级菜单'</blockquote>
        <blockquote class="layui-elem-quote">一级菜单选择停用下级的子菜单也不能正常工作</blockquote>

        <div class="layui-form-item">
            <label class="layui-form-label">菜单名称</label>
            <div class="layui-input-block">
                <input type="text"  name='name' value="{$info.name|default=''}" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">菜单类型</label>
            <div class="layui-input-block">
                <select name="type" >
                    <volist name="wx_type" id="vo" key="k">
                        <option value="{$k}"  <eq name="info['type']" value="$k">selected="selected"</eq> > {$vo} </option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">菜单状态</label>
            <div class="layui-input-block">
                <select name="status" lay-verify="required">
                    <option value="1"  <notempty name="info.status"><eq name="info['status']" value="1">selected="selected"</eq></notempty>>正常</option>
                    <option value="2"  <notempty name="info.status"><eq name="info['status']" value="2">selected="selected"</eq></notempty>>禁用</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">菜单内容</label>
            <div class="layui-input-block">
                <input type="text" name="info" value="{$info.info|default=''}" class="layui-input" placeholder="一级菜单可以为空">
            </div>
        </div>
        <input type="hidden" name="pid" value="{$info.pid|default=''}">
        <input type="hidden" name="id" value="{$info.id|default=''}">

    </form>

</div>
<link rel="stylesheet" href="https://cdn.weibuyun.com/static/admin/plugins/formSelects-v4.css">

<script type="text/javascript">
    layui.use(['form', 'layer', 'formSelects', 'upload'], function () {
        var form = layui.form
            , formSelects = layui.formSelects
            , $ = layui.$
            ,upload=layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#test1',
            url: '{:url("/file/upload",["type"=>"image"])}',
            done: function (res) {
                var input = '#test1';
                $(input).closest('.avatar-add').find('.loading').hide();
                if (res.code == 0) {
                    $(input).closest('.avatar-add').find('img').attr('src', res.data.src);
                    $('#img').val(res.data.src);
                } else {
                    layer.msg(res.msg);
                }
            }

        });


    });
</script>






